<template>
  <el-button @click="show">测试</el-button>
</template>

<script lang="ts">
import { defineComponent, getCurrentInstance } from 'vue'
export default defineComponent({
  setup() {
    const app = getCurrentInstance()
    // console.log(app.proxy.$message)
    const show = () => {
      // console.log(ctx)
      app.proxy.$message.success({
        message: '恭喜你，这是一条成功消息',
        type: 'success',
      })
    }
    return {
      show,
    }
  },
})
</script>

<style lang="scss" scoped>
.test{
  color: red;
}
</style>
